import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:ruida_bottom_demo/app/components/safe_verify.dart';

import '../controllers/verify_page_controller.dart';

class VerifyPageView extends GetView<VerifyPageController> {
  const VerifyPageView({super.key});

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        if (Navigator.of(context).userGestureInProgress) {
          return false;
        } else {
          return true;
        }
      },
      child: Scaffold(
        appBar: AppBar(
          title: const Text('VerifyPageView'),
          centerTitle: true,
        ),
        body: SizedBox(
          width: double.infinity,
          child: Column(
            children: [
              const SizedBox(
                height: 12,
              ),
              const Text(
                "安全验证",
                style: TextStyle(fontSize: 30),
              ),
              const SizedBox(
                height: 20,
              ),
              const Text("为了你的账号安全，本次登录需要进行验证"),
              const Text("请将下方的图标移动到圆形区域内"),
              const SizedBox(
                height: 20,
              ),
              Expanded(child: DemoVerify(lister: (state) {
                debugPrint("longer 返回状态>>> ${state}");
                if (state) {
                  Get.back(result: true);
                }
              }))
            ],
          ),
        ),
      ),
    );
  }
}
